package com.xinxin.blockchain.asset.strategy;

import com.xinxin.blockchain.asset.exception.AssetShortageException;
import com.xinxin.blockchain.model.AccountAsset;
import com.xinxin.blockchain.service.IAccountAssetService;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;

/**
 * @author ys
 * @date 2021/5/24
 */
public abstract class AssetOperateStrategy {

    @Autowired
    protected IAccountAssetService accountAssetService;

    /**
     * 资产操作
     */
    public abstract boolean operate(AccountAsset asset, BigDecimal amount) throws AssetShortageException;
}
